package com.milasoft.queueingcloud;

import com.parse.ParseObject;

import android.app.ActionBar;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.drawable.ColorDrawable;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class AdminPageActivity extends ActionBarActivity{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.admin_page);
		final EditText placeName= (EditText)findViewById(R.id.tvPlace);
		final EditText addressName= (EditText)findViewById(R.id.tvAddress);
		final EditText ipName=(EditText)findViewById(R.id.tvIp);
		
		
		Button button = (Button) findViewById(R.id.cloudDatabase);
		button.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				ParseObject testObject = new ParseObject("PlaceTable");
				testObject.put("PlaceName", placeName.getText().toString());
				testObject.put("AddressName", addressName.getText().toString());
				testObject.put("IpName", ipName.getText().toString());
				testObject.saveInBackground(); 
			}
		});
		
		Button showButton = (Button) findViewById(R.id.showQueue);
		showButton.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				Intent userPageActivity = new Intent(AdminPageActivity.this,
						ShowQueueHandler.class);
				startActivity(userPageActivity);

			}
		});
	}
	

	
}
